#!/bin/bash
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

cd $SCRIPT_DIR

echo "Usage: $SCRIPT_DIR"

current_time=$(date +"%Y-%m-%d-%H-%M-%S")
# 检查第一个参数，如果不存在将使用默认值 "default"
record_name=${1:-0}
record_name=Apriltag_$record_name"_$current_time"

echo  "record_name: " $record_name

save_path="bag"
cd
mkdir -p $save_path

rosbag record /zhz/driver/cam0/image_raw/camera_info \
/zhz/driver/cam0/image_raw_camera_info \
# rosbag record /zhz/camera/camera_info  \
# /zhz/camera/image_l \
# /zhz/camera_path \
# /zhz/apriltag_pose \
# /zhz/camera_path1 \
# /zhz/camera_path2 \
# /zhz/camera_path3 \
# /zhz/camera_path4 \
# /zhz/camera_path5 \
# /zhz/camera_path6 \
# /zhz/camera_pose \
-O $save_path/$record_name 